include ../rules.mk

SOURCES :=       \
	types.c        \
	sys/string.c   \
	sys/list.c     \
	sys/rand.c     \
	sys/wtime.c    \
	sys/arrays.c   \
	sys/pid.c      \
	io/xyz.c       \
	io/gro.c       \
	io/options.c   \
	io/mds.c       \
	vector.c       \
	vector_set.c   \
	ini/position.c \
	ini/velocity.c \
	ini/crystal.c  \
	frame.c        \
	step.c         \
	dynamics.c     \
	lj.c           \
	lj-cutoff.c    \
	step/verlet.c  \
	step/beeman.c  \
	hasten/cells.c \
	hasten/cells-dyn.c \
	run.c          \
	constants.c    \
	engine.c       \
	pnode.c        \
	density.c
	
OBJECTS := $(call to_object,$(SOURCES))
DEPENDS := $(OBJECTS:.o=.d)

all: enter lib leave

info:
	echo $(OBJECTS)
	
enter:
	@echo "==> building in $(HERE)"

leave:
	@echo "==> all done in $(HERE)"

lib: ../.libs/libmds.a

../.libs/libmds.a: $(OBJECTS)
	@echo "====> Archiving $@"
	@ar cruv $@ $^
	@echo "====> Finished"
	
clean:
	$(CLEAN)
	$(MAKE) -s -C sys clean
	$(MAKE) -s -C io clean
	$(MAKE) -s -C ini clean
	$(MAKE) -s -C step clean
	$(MAKE) -s -C hasten clean
	$(MAKE) -s -C tests clean
	
-include $(DEPENDS)
	

